package com.github.reweber.androidasyncsocketexamples.base;

import android.support.v4.app.Fragment;


public  abstract class Base_Fragment extends Fragment {


    public Base_Fragment() {

    }



    public boolean isvisible;

    @Override
    public void setUserVisibleHint(boolean isVisibleToUser) {
        super.setUserVisibleHint(isVisibleToUser);
        if (getUserVisibleHint()) {
            isvisible = true;
            onVisible();
        } else {
            isvisible = false;
            onInVisible();
        }
    }

    /**
     * 视图不可见
     */
    private void onInVisible() {

    }

    /**
     * 视图可见
     */
    private void onVisible() {
        lazyLoad();
    }

    public abstract void lazyLoad();






}
